import api from "../../api/api";
export function dictionaries(group) {
  let list = [];
  api
    .getListAPI("auth/tools/dictionary", {
      group: group,
    })
    .then((res) => {
      if (res.data.code == 1) {
        list = res.data.data;
        console.log(list);
      } else {
        ElMessage.error(res.data.message);
      }
    })
    .catch((err) => { });
  setTimeout(function () {
    return list;
  }, 1000);
}
// 获取碳量
export function getRemainCarbon(group) {
  return new Promise(function (resolve, reject) {
    api
      .getListAPI("trade/client/carbon/wallet/getDetail", {})
      .then((res) => {
        if (res.data.code == 1) {
          resolve(res.data.data);
        } else {
          ElMessage.error(res.data.message);
        }
      })
      .catch((err) => { });
  });
}
